﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using NUnit.Framework;
using Agility.Web;

namespace Agility.Testing.Silverlight.ViewModels
{
    [TestFixture]
    public class UserTests
    {
        #region optional setup and tear down methods
        //// Called before the first test to setup the whole fixture
        //[TestFixtureSetUp]
        //public void TestFixtureSetup()
        //{
        //}

        //// Called after the last test to tear down the whole fixture
        //[TestFixtureTearDown]
        //public void TestFixtureTearDown()
        //{
        //}

        //// Called before each test
        //[SetUp]
        //public void TestSetup()
        //{
        //}

        //// Called after each test
        //[TearDown]
        //public void TestTearDown()
        //{ 
        //}

        #endregion

        [Test]
        [Category("UnitTest")]
        public void TestPropertyChangedEvent()
        {
            // Arrange
            User target = new User();
            string expected = "DisplayName";
            string actual = string.Empty;
            bool propertyChangedEventFired = false;

            // Act
            target.PropertyChanged += (s, e) =>
            {
                propertyChangedEventFired = true;
                actual = e.PropertyName;
            };
            target.FriendlyName = "Some other name";

            // Assert
            Assert.IsTrue(propertyChangedEventFired);
            Assert.AreEqual(expected, actual);
        }

    }
}
